home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-SPAR.{_A / SHMPARAM.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  2KB  |  48 lines

  1. /* $Id: shmparam.h,v 1.3 1998/09/28 07:15:03 jj Exp $ */
  2. #ifndef _ASMSPARC64_SHMPARAM_H
  3. #define _ASMSPARC64_SHMPARAM_H
  4.  
  5. /* XXX Redo most of this... */
  6.  
  7. /* address range for shared memory attaches if no address passed to shmat() */
  8. #define SHM_RANGE_START    0x10000000
  9. #define SHM_RANGE_END    0x20000000
  10.  
  11. /*
  12.  * Format of a swap-entry for shared memory pages currently out in
  13.  * swap space (see also mm/swap.c).
  14.  *
  15.  * SWP_TYPE = SHM_SWP_TYPE
  16.  * SWP_OFFSET is used as follows:
  17.  *
  18.  *  bits 0..6 : id of shared memory segment page belongs to (SHM_ID)
  19.  *  bits 7..21: index of page within shared memory segment (SHM_IDX)
  20.  *        (actually fewer bits get used since SHMMAX is so low)
  21.  */
  22.  
  23. /*
  24.  * Keep _SHM_ID_BITS as low as possible since SHMMNI depends on it and
  25.  * there is a static array of size SHMMNI.
  26.  */
  27. #define _SHM_ID_BITS    7
  28. #define SHM_ID_MASK    ((1<<_SHM_ID_BITS)-1)
  29.  
  30. #define SHM_IDX_SHIFT    (_SHM_ID_BITS)
  31. #define _SHM_IDX_BITS    15
  32. #define SHM_IDX_MASK    ((1<<_SHM_IDX_BITS)-1)
  33.  
  34. /*
  35.  * _SHM_ID_BITS + _SHM_IDX_BITS must be <= 24 on the i386 and
  36.  * SHMMAX <= (PAGE_SIZE << _SHM_IDX_BITS).
  37.  */
  38.  
  39. #define SHMMAX 0x1000000        /* max shared seg size (bytes) */
  40. #define SHMMIN 1 /* really PAGE_SIZE */    /* min shared seg size (bytes) */
  41. #define SHMMNI (1<<_SHM_ID_BITS)    /* max num of segs system wide */
  42. #define SHMALL                /* max shm system wide (pages) */ \
  43.     (1<<(_SHM_IDX_BITS+_SHM_ID_BITS))
  44. #define    SHMLBA (PAGE_SIZE<<1)        /* attach addr a multiple of this */
  45. #define SHMSEG SHMMNI            /* max shared segs per process */
  46.  
  47. #endif /* _ASMSPARC64_SHMPARAM_H */
  48.